/*
 * @Description: demos路由
 * @Author: wangqi
 * @Date: 2022-04-28 15:24:03
 * @LastEditTime: 2022-04-28 17:54:09
 */

import { type RouteRecordRaw } from 'vue-router';
import RouterView from '@/layout/routerView/index.vue';
const moduleName = 'demos';

const routes: RouteRecordRaw[] = [
  {
    path: '/demos',
    name: moduleName,
    // redirect: `/${moduleName}/nested-routes`,
    redirect: { name: `${moduleName}-nested-routes` },
    component: RouterView,
    meta: {
      title: 'demos',
      icon: 'icon-shouye',
    },
    children: [
      {
        path: 'nested-routes',
        name: `${moduleName}-nested-routes`,
        redirect: `/${moduleName}/nested-routes/route-one`,
        meta: {
          title: '嵌套路由',
          icon: 'icon-zhuomian',
          hideChildrenInMenu: true,
        },
        component: () => import('@/views/demos/nested-routes/index.vue'),
        children: [
          {
            path: 'route-one',
            name: `${moduleName}-nested-routes-one`,
            meta: {
              title: '嵌套路由一',
              icon: 'icon-zhuomian',
            },
            component: () => import('@/views/demos/nested-routes/route-one.vue'),
          },

          {
            path: 'route-tow',
            name: `${moduleName}-nested-routes-two`,
            meta: {
              title: '嵌套路由二',
              icon: 'icon-zhuomian',
            },
            component: () => import('@/views/demos/nested-routes/route-tow.vue'),
          },
        ],
      },
    ],
  },
];

export default routes;
